import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StaffSkillVO, StaffSkillForm, StaffSkillQuery } from '@/api/nursing/staffSkill/types';

/**
 * 查询员工专业技能列表
 * @param query
 * @returns {*}
 */

export const listStaffSkill = (query?: StaffSkillQuery): AxiosPromise<StaffSkillVO[]> => {
  return request({
    url: '/nursing/staffSkill/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询员工专业技能详细
 * @param skillId
 */
export const getStaffSkill = (skillId: string | number): AxiosPromise<StaffSkillVO> => {
  return request({
    url: '/nursing/staffSkill/' + skillId,
    method: 'get'
  });
};

/**
 * 新增员工专业技能
 * @param data
 */
export const addStaffSkill = (data: StaffSkillForm) => {
  return request({
    url: '/nursing/staffSkill',
    method: 'post',
    data: data
  });
};

/**
 * 修改员工专业技能
 * @param data
 */
export const updateStaffSkill = (data: StaffSkillForm) => {
  return request({
    url: '/nursing/staffSkill',
    method: 'put',
    data: data
  });
};

/**
 * 删除员工专业技能
 * @param skillId
 */
export const delStaffSkill = (skillId: string | number | Array<string | number>) => {
  return request({
    url: '/nursing/staffSkill/' + skillId,
    method: 'delete'
  });
};
